#include "Body.h"
#include "Sprite.h"
#include "RSManager.h"
#include "GameDefine.h"

Body::Body(void) : IComponent(BODY1)
{
	_delay = 0;
}


Body::~Body(void)
{
}



void Body::render(D3DXVECTOR2 pos)
{
	_currentSprite->Render(pos);
}

void Body::setSprite(SPRITE_ID id)
{	
	_currentSprite = RSManager::getInstance()->getSprite(id);
}

void Body::update()
{
	_delay += GAME_TIME;
	if (_delay > 150)	
	{
		_currentSprite->Next();
		_delay = 0;
	}
}

void Body::init()
{
	_currentSprite = RSManager::getInstance()->getSprite(GO_RIGHT);
}
